package ru.eas.packer;

import java.util.ArrayList;
import java.util.List;

/**
 * @author aesipov
 */
public class Box {
    private int width;
    private int height;
    private int depth;

    private boolean rotate;
    private boolean toponly;

    public Box(int width, int height, int depth, boolean rotate, boolean toponly) {
        this.width = width;
        this.height = height;
        this.depth = depth;
        this.rotate = rotate;
        this.toponly = toponly;
    }

    public List<Box> getAllRotations() {
        List<Box> result = new ArrayList<Box>();
        result.add(this);
        if (rotate) {
            result.add(new Box(height, width, depth, rotate, toponly));
            result.add(new Box(width, depth, height, rotate, toponly));
        }
        return result;
    }

    public int getWidth() {
        return width;
    }

    public int getHeight() {
        return height;
    }

    public int getDepth() {
        return depth;
    }

    public boolean isRotate() {
        return rotate;
    }

    public boolean isToponly() {
        return toponly;
    }

    public int getVolume() {
        return width * height * depth;
    }
}
